package com.newspring;

import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.*;

@Configuration
@ComponentScan("com.newspring")
//导入配置类
//@Import(com.newspring.Test.class)
public class    UntilConfig {
    @Bean
    public User getUser(){
        return new User();
    }
    @Test
    public void getAnn(){
        ApplicationContext context  = new AnnotationConfigApplicationContext(UntilConfig.class);
        User user = context.getBean(User.class);
        System.out.println( user.getName());
    }
}
